import { NMNode } from "../Base/NodeGraph";
import { NodeRoot } from "../Base/NodeRoot";
@NMNode
export class AlphaTime extends NodeRoot{
    public Node:any;
    public StartAlpha:number;
    public EndAlpha:number;
    public Time:number;
    private setNode:cc.Node;
    private completed=false;
    onEnter(){
        this.setNode=this.Node;
        if(!this.setNode){
            this.setNode=this.ownerNode;
        }
        this.setNode.opacity=this.StartAlpha;
        this.setNode.runAction(cc.sequence([
            cc.fadeTo(this.Time,this.EndAlpha),
            cc.callFunc(()=>this.completed=true,this)
        ]));
    }
    onStep(dt){
        return this.completed;
    }
}